<template>
    <div>
        <ul>
            <li v-for="item in getnewslist" :key="item._id">
                <router-link :to="{name:'detail',params:{id:item._id}}">{{item.title}}</router-link>
            </li>
        </ul>
    </div>
</template>
<script>
export default {
  mounted(){
      this.$store.dispatch({
          type:"getnewslist"
      })
  },
computed:{
    getnewslist(){
        return this.$store.state.newslist
    }
}
}
</script>